var arr = null;
var exeCount = 0;

console.log("==========对无序的数组进行排序=======")

arr = [1,4,5,1,11,1,3,4,8,15,1];
console.log("待排序数据:",arr)
exeCount = quickSort(arr);
console.log("[快速排序]后的数组:",arr)
console.log("[快速排序]的执行次数:",exeCount)

arr = [9,4,5,1,11,27,3,4,8,15,7];
// arr = [11, 9, 8];
console.log("待排序数据:",arr)
exeCount = quickSort(arr);
console.log("[快速排序]后的数组:",arr)
console.log("[快速排序]的执行次数:",exeCount)


arr = [9, 4, 5, 1, 11, 27, 3, 4, 8, 15, 7];
console.log("待排序数据:",arr)
exeCount = bubbleSort(arr);
console.log("[冒泡排序]后的数组:",arr)
console.log("[冒泡排序]的执行次数:",exeCount)

arr = [9, 4, 5, 1, 11, 27, 3, 4, 8, 15, 7];
console.log("待排序数据:",arr)
exeCount = bubbleSortWithFlag(arr);
console.log("[冒泡排序]后的数组:",arr)
console.log("[冒泡排序]的执行次数:",exeCount)


arr = [9, 4, 5, 1, 11, 27, 3, 4, 8, 15, 7];
console.log("待排序数据:",arr)
exeCount = selectionSort(arr);
console.log("[选择排序]后的数组:",arr)
console.log("[选择排序]的执行次数:",exeCount)

arr = [9, 4, 5, 1, 11, 27, 3, 4, 8, 15, 7];
console.log("待排序数据:",arr)
exeCount = insertionSortSlow(arr);
console.log("[插入排序]后的数组:",arr)
console.log("[插入排序]的执行次数:",exeCount)


arr = [9, 4, 5, 1, 11, 27, 3, 4, 8, 15, 7];
console.log("待排序数据:",arr)
exeCount = insertionSort(arr);
console.log("[插入排序]后的数组:",arr)
console.log("[插入排序]的执行次数:",exeCount)

console.log("==========对有序的数组进行排序=======")

arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
console.log("待排序数据:",arr)
exeCount = quickSort(arr);
console.log("[快速排序]后的数组:",arr)
console.log("[快速排序]的执行次数:",exeCount)

arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
console.log("待排序数据:",arr)
exeCount = bubbleSort(arr);
console.log("[冒泡排序]后的数组:",arr)
console.log("[冒泡排序]的执行次数:",exeCount)


arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
console.log("待排序数据:",arr)
exeCount = bubbleSortWithFlag(arr);
console.log("[冒泡排序]后的数组:",arr)
console.log("[冒泡排序]的执行次数:",exeCount)

arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
console.log("待排序数据:",arr)
exeCount = selectionSort(arr);
console.log("[选择排序]后的数组:",arr)
console.log("[选择排序]的执行次数:",exeCount)

arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
console.log("待排序数据:",arr)
exeCount = insertionSortSlow(arr);
console.log("[插入排序]后的数组:",arr)
console.log("[插入排序]的执行次数:",exeCount)


arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
console.log("待排序数据:",arr)
exeCount = insertionSort(arr);
console.log("[插入排序]后的数组:",arr)
console.log("[插入排序]的执行次数:",exeCount)

console.log("==========对相等的数组进行排序=======")
arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
console.log("待排序数据:",arr)
exeCount = quickSort(arr);
console.log("[快速排序]后的数组:",arr)
console.log("[快速排序]的执行次数:",exeCount)

arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
console.log("待排序数据:",arr)
exeCount = bubbleSort(arr);
console.log("[冒泡排序]后的数组:",arr)
console.log("[冒泡排序]的执行次数:",exeCount)

arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
console.log("待排序数据:",arr)
exeCount = bubbleSortWithFlag(arr);
console.log("[冒泡排序]后的数组:",arr)
console.log("[冒泡排序]的执行次数:",exeCount)

arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
console.log("待排序数据:",arr)
exeCount = selectionSort(arr);
console.log("[选择排序]后的数组:",arr)
console.log("[选择排序]的执行次数:",exeCount)

arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
console.log("待排序数据:",arr)
exeCount = insertionSortSlow(arr);
console.log("[插入排序]后的数组:",arr)
console.log("[插入排序]的执行次数:",exeCount)

arr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
console.log("待排序数据:",arr)
exeCount = insertionSort(arr);
console.log("[插入排序]后的数组:",arr)
console.log("[插入排序]的执行次数:",exeCount)